//package com.luoran.car.controller;
//
//import com.alipay.api.AlipayApiException;
//import com.alipay.api.AlipayClient;
//import com.alipay.api.AlipayConfig;
//import com.alipay.api.DefaultAlipayClient;
//import com.alipay.api.domain.AlipayTradePagePayModel;
//import com.alipay.api.domain.AlipayTradeQueryModel;
//import com.alipay.api.domain.AlipayTradeRefundModel;
//import com.alipay.api.internal.util.AlipaySignature;
//import com.alipay.api.request.AlipayTradePagePayRequest;
//import com.alipay.api.request.AlipayTradeQueryRequest;
//import com.alipay.api.request.AlipayTradeRefundRequest;
//import com.alipay.api.response.AlipayTradePagePayResponse;
//import com.alipay.api.response.AlipayTradeQueryResponse;
//import com.alipay.api.response.AlipayTradeRefundResponse;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInfo;
//import com.luoran.car.domain.SysCarOrder;
//import com.luoran.car.service.SysCarOrderService;
//import com.luoran.car.util.Result;
//import com.luoran.common.core.web.domain.AjaxResult;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.util.*;
//
//@RestController
//@RequestMapping("order")
//public class OrderController {
//
//    @Autowired
//    SysCarOrderService orderService;
//
//    @RequestMapping("orderList")
//    public Result orderList(@RequestParam Integer id) {
//
//        LambdaQueryWrapper<SysCarOrder> wrapper = new LambdaQueryWrapper<>();
//        wrapper.eq(SysCarOrder::getUserId, id);
//
//        List<SysCarOrder> list = orderService.list(wrapper);
//
//        return Result.success(list);
//    }
//
//    @RequestMapping("toPay")
//    public Result toPay(@RequestParam Integer id) throws AlipayApiException {
//
//        SysCarOrder byId = orderService.getById(id);
//
//        String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSzwvszJygyxikQT42ioH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VeE3n0C4NwHqLaBak+QYD3GatcGtMLUtmBIl6BPYFeK28V1Yj0bTCCslFJ6L+/Kt+ThbFTsPAquHel7Bts75F5jjQ+l14yqHB9JBB4KWbZt8fFBOpN95lZwKBgC5OxHBlU86yGmjA2uX/e7WE08km2sM+kjjQTQ0wo3E9ZLHhp0r0Ij3B/fvtHuVhU+Cza9to59bdoyxbe3yF/IOhZ7AhZkJyRon7Y9i/3VVShr4lbnXTEv1Z9WFyp/IyeCRfMQLhpMSEh3FKCwEG3GnzwO04jK4hwllfclSr7REXAoGBAIzK1KB3ODCEibZXCatijp2/d0cdSQQFHwF4aHqM21SwADrc7ZZGJO9945/YtDrR1fHb0w9GhJiEtTU1rygiCV3D6/NtudN/wiMwB1gb74MT2w3v8FEclDkiGyXQ5RAdw56uaZUCech8PcXEnsp/PKXmLuSI8nApeFje2zbIyIMt";
//        String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApsYoZOD6GOAICIJET/k7muiM9JIQJKTuPxqwyfK5Xi4QATUNR8HHAm+wAioVBamjpvX08oYecwdALkaKHM3+ff1vBRI/kWrDDsas01ZKeeHH9cx6nreBqMQwck8akRTRN8c/37Qfcg5AF3/FF9KA/CIObfUk5rovFrFaIzCm4H8qtq+uwD9vL57S4C92EyE72TilkQ4m4SY00cp2qfNwy14qu+AD/sWT0h2G6BnAMIzDs9Xyq6HPoyVSECKS38lijzTw5fS1A/hc9ADm3kDd3h0Rg7OAcdO/GTvgqPjGzyeidO3c4Dw4qiHoyYfkq7Oyk/4Qzk/HYDG3tjTbYYMk6wIDAQAB";
//        AlipayConfig alipayConfig = new AlipayConfig();
//        alipayConfig.setServerUrl("https://openapi-sandbox.dl.alipaydev.com/gateway.do");
//        alipayConfig.setAppId("9021000132629610");
//        alipayConfig.setPrivateKey(privateKey);
//        alipayConfig.setFormat("json");
//        alipayConfig.setAlipayPublicKey(alipayPublicKey);
//        alipayConfig.setCharset("UTF-8");
//        alipayConfig.setSignType("RSA2");
//        AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
//        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
//        request.setReturnUrl("http://localhost:10018/order/callback");
//        AlipayTradePagePayModel model = new AlipayTradePagePayModel();
//        model.setOutTradeNo(byId.getOrderNum());
//        model.setTotalAmount(byId.getOrderPrice().add(byId.getCashPledge()) + "");
//        model.setSubject(byId.getOrderSubject());
//        model.setProductCode("FAST_INSTANT_TRADE_PAY");
//        request.setBizModel(model);
//        AlipayTradePagePayResponse response = alipayClient.pageExecute(request, "POST");
//        // 如果需要返回GET请求，请使用
//        // AlipayTradePagePayResponse response = alipayClient.pageExecute(request, "GET");
//        String pageRedirectionData = response.getBody();
//        System.out.println(pageRedirectionData);
//        if (response.isSuccess()) {
//            System.out.println("调用成功");
//            return Result.success(pageRedirectionData);
//        }
//
//        return Result.success();
//    }
//
//    @RequestMapping("callback")
//    public void callback(HttpServletRequest request, HttpServletResponse response) throws Exception {
//        String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSzwvszJygyxikQT42ioHgnlLJAnNBseM648Gdf7IPs8bpSVtZbUq31ic8z7dK2ROSlhaTUK6+vw/OCA3qzPHV5PEsicL4b/nxAJkWDe32VzRDSFev2xmoSIkJP3zlDFOERMGiia3yrKY2xHcjOtYSUw4IimU+5EEgtXquRkCKYyTVpT5WfeFcxxhVAilnM1dAsd9LNr8l24WQdu2aCo1qGbDY4GzNkvBTDokCqnqKZTkglk6fpRQZSvq2B6EOgiun2dZKV7pRnW8P/954OAqNC+qBQSNWYxCcvgsW/2MdfM4vmvWUlpBTCHExyNXi3bzUGJRzcgQ5e8dR+l0Y0G0VAgMBAAECggEAdPbMc29ZYqotCcCJRn73lvPM1SVEmpSVi3el7Euum+AJnBe71fXDT9ApFsQPLmzgsSsu9VOUxZgHiYjVPbrm+hkbJPblBXaBVce6L94NNvSnSOu8IPmY6YBQ3bNdWEeHypvV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bIyIMt";
//        String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApsYoZOD6GOAICIJET/k7muiM9JIQJKTuPxqwyfK5Xi4QATUNR8HHAm+wAioVBamjpvX08oYecwdALkaKHM3+ff1vBRI/kWrDDsas01ZKeeHH9cx6nreBqMQwck8akRTRN8c/37Qfcg5AF3/FF9KA/CIObfUk5rovFrFaIzCm4H8qtq+uwD9vL57S4C92EyE72TilkQ4m4SY00cp2qfNwy14qu+AD/sWT0h2G6BnAMIzDs9Xyq6HPoyVSECKS38lijzTw5fS1A/hc9ADm3kDd3h0Rg7OAcdO/GTvgqPjGzyeidO3c4Dw4qiHoyYfkq7Oyk/4Qzk/HYDG3tjTbYYMk6wIDAQAB";
//        AlipayConfig alipayConfig = new AlipayConfig();
//        alipayConfig.setServerUrl("https://openapi-sandbox.dl.alipaydev.com/gateway.do");
//        alipayConfig.setAppId("9021000132629610");
//        alipayConfig.setPrivateKey(privateKey);
//        alipayConfig.setFormat("json");
//        alipayConfig.setAlipayPublicKey(alipayPublicKey);
//        alipayConfig.setCharset("UTF-8");
//        alipayConfig.setSignType("RSA2");
//
//        Map<String, String> params = new HashMap<String, String>();
//        Map<String, String[]> requestParams = request.getParameterMap();
//        for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext(); ) {
//            String name = (String) iter.next();
//            String[] values = (String[]) requestParams.get(name);
//            String valueStr = "";
//            for (int i = 0; i < values.length; i++) {
//                valueStr = (i == values.length - 1) ? valueStr + values[i]
//                        : valueStr + values[i] + ",";
//            }
//            //乱码解决，这段代码在出现乱码时使用
//            valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
//            params.put(name, valueStr);
//        }
//
//        boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayConfig.getAlipayPublicKey(), alipayConfig.getCharset(), alipayConfig.getSignType()); //调用SDK验证签名
//
//        //——请在这里编写您的程序（以下代码仅作参考）——
//        if (signVerified) {
//            //商户订单号
//            String out_trade_no = new String(request.getParameter("out_trade_no").getBytes("ISO-8859-1"), "UTF-8");
//
//            //支付宝交易号
//            String trade_no = new String(request.getParameter("trade_no").getBytes("ISO-8859-1"), "UTF-8");
//
//            LambdaQueryWrapper<SysCarOrder> wrapper = new LambdaQueryWrapper<>();
//            wrapper.eq(SysCarOrder::getOrderNum, out_trade_no);
//
//            SysCarOrder one = orderService.getOne(wrapper);
//
//            one.setStatus("1");
//
//            orderService.updateById(one);
//
//            response.sendRedirect("http://localhost:8080/carOrder");
//        }
//
//
//    }
//
//
//    @RequestMapping("refund")
//    public Result refund(@RequestParam Integer id) throws AlipayApiException {
//        String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSzwvszJygyxikQT42ioHgnlLJAnNBseM648Gdf7IPs8bpSVtZbUq31ic8z7dK2ROSlhaTUK6+vw/OCA3qzPHV5PEsicL4b/nxAJkWDe32VzRDSFev2xmoSIkJP3zlDFOERMGiia3yrKY2xHcjOtYSUw4IimU+5EEgtXquRkCKYyTVpT5WfeFcxxhVAilnM1dAsd9LNr8l24WQdu2aCo1qGbDY4GzNkvBTDokCqnqKZTkglk6fpRQZSvq2B6EOgiun2dZKV7pRnW8P/954OAqNC+qBQSNWYxCcvgsW/2MdfM4vmvWUlpBTCHExyNXi3bzUGJRzcgQ5e8dR+l0Y0G0VAgMBAAECggEAdPbMc29ZYqotCcCJRn73lvPM1SVEmpSVi3el7Euum+AJnBe71fXDT9ApFsQPLmzgsSsu9VOUxZgHiYjVPbrm+hkbJPblBXaBVce6L94NNvSnSOu8IPmY6YBQ3bNdWEeHypvVAiBbHDr9eijxGnpnz9WoGpnYrFDCqsKr6WlDRn0Uak5duSfAPt7nu3yXVsRQs7/5gOe7TsJ+jv37lHTeG0riwq2tx+Wj80urd4Rnvu0PBBKupGb8g0eAJPksbY1jxKJ0m1XlbmnQsof+CLbsCISzD/0VXSfdWNqnCXmoL5Zs8uOs6Q8FS70hdmKJGig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8c/37Qfcg5AF3/FF9KA/CIObfUk5rovFrFaIzCm4H8qtq+uwD9vL57S4C92EyE72TilkQ4m4SY00cp2qfNwy14qu+AD/sWT0h2G6BnAMIzDs9Xyq6HPoyVSECKS38lijzTw5fS1A/hc9ADm3kDd3h0Rg7OAcdO/GTvgqPjGzyeidO3c4Dw4qiHoyYfkq7Oyk/4Qzk/HYDG3tjTbYYMk6wIDAQAB";
//        AlipayConfig alipayConfig = new AlipayConfig();
//        alipayConfig.setServerUrl("https://openapi-sandbox.dl.alipaydev.com/gateway.do");
//        alipayConfig.setAppId("9021000132629610");
//        alipayConfig.setPrivateKey(privateKey);
//        alipayConfig.setFormat("json");
//        alipayConfig.setAlipayPublicKey(alipayPublicKey);
//        alipayConfig.setCharset("UTF-8");
//        alipayConfig.setSignType("RSA2");
//
//
//        SysCarOrder byId = orderService.getById(id);
//
//
////        if (byId.getStatus()){
////
////        }
//
//        AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
//        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
//        AlipayTradeRefundModel model = new AlipayTradeRefundModel();
//        model.setOutTradeNo(byId.getOrderNum());
//        model.setRefundAmount(byId.getOrderPrice() + "");
//        request.setBizModel(model);
//        AlipayTradeRefundResponse response = alipayClient.execute(request);
//        System.out.println(response.getBody());
//        if (response.isSuccess()) {
//            byId.setStatus("2");
//            orderService.updateById(byId);
//
//            return Result.success("退款成功");
//        }
//
//        return Result.fail("退款失败");
//    }
//
//    @RequestMapping("query")
//    public void query() throws AlipayApiException {
//
//        String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSzwvszJygyxikQT42ioHgnlLJAnNBseM648Gdf7IPs8bpSVtZbUq31ic8z7dK2ROSlhaTUK6+vw/OCA3qzPHV5PEsicL4b/nxAJkWDe32VzRDSFev2xmoSIkJP3zlDFOERMGiia3yrKY2xHcjOtYSUw4IimU+5EEgtXquRkCKYyTVpT5WfeFcxxhVAiln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ZLHhp0r0Ij3B/fvtHuVhU+Cza9to59bdoyxbe3yF/IOhZ7AhZkJyRon7Y9i/3VVShr4lbnXTEv1Z9WFyp/IyeCRfMQLhpMSEh3FKCwEG3GnzwO04jK4hwllfclSr7REXAoGBAIzK1KB3ODCEibZXCatijp2/d0cdSQQFHwF4aHqM21SwADrc7ZZGJO9945/YtDrR1fHb0w9GhJiEtTU1rygiCV3D6/NtudN/wiMwB1gb74MT2w3v8FEclDkiGyXQ5RAdw56uaZUCech8PcXEnsp/PKXmLuSI8nApeFje2zbIyIMt";
//        String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApsYoZOD6GOAICIJET/k7muiM9JIQJKTuPxqwyfK5Xi4QATUNR8HHAm+wAioVBamjpvX08oYecwdALkaKHM3+ff1vBRI/kWrDDsas01ZKeeHH9cx6nreBqMQwck8akRTRN8c/37Qfcg5AF3/FF9KA/CIObfUk5rovFrFaIzCm4H8qtq+uwD9vL57S4C92EyE72TilkQ4m4SY00cp2qfNwy14qu+AD/sWT0h2G6BnAMIzDs9Xyq6HPoyVSECKS38lijzTw5fS1A/hc9ADm3kDd3h0Rg7OAcdO/GTvgqPjGzyeidO3c4Dw4qiHoyYfkq7Oyk/4Qzk/HYDG3tjTbYYMk6wIDAQAB";
//        AlipayConfig alipayConfig = new AlipayConfig();
//        alipayConfig.setServerUrl("https://openapi-sandbox.dl.alipaydev.com/gateway.do");
//        alipayConfig.setAppId("9021000132629610");
//        alipayConfig.setPrivateKey(privateKey);
//        alipayConfig.setFormat("json");
//        alipayConfig.setAlipayPublicKey(alipayPublicKey);
//        alipayConfig.setCharset("UTF-8");
//        alipayConfig.setSignType("RSA2");
//
//        List<SysCarOrder> list = orderService.list();
//        for (SysCarOrder order : list) {
//            AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
//            AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
//            AlipayTradeQueryModel model = new AlipayTradeQueryModel();
//            model.setOutTradeNo(order.getOrderNum());
//            request.setBizModel(model);
//            AlipayTradeQueryResponse response = alipayClient.execute(request);
//            System.out.println(response.getBody());
//            if (response.isSuccess()) {
//                System.out.println("调用成功");
//            } else {
//                System.out.println("调用失败");
//            }
//
//        }
//
//    }
//
//    @RequestMapping("cancel")
//    public Result cancelOrder(@RequestParam Integer id){
//
//        SysCarOrder byId = orderService.getById(id);
//
//        byId.setStatus("1");
//
//        orderService.updateById(byId);
//
//        return Result.fail();
//    }
//
//    @RequestMapping("getOrderById")
//    public Result getOrderById(@RequestParam Integer id){
//
//        SysCarOrder order=orderService.getOrderById(id);
//
//        return Result.success(order);
//    }
//
//
//
//
//}
//
//
